package com.rowmapper;

import com.dto.UserDto;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper<UserDto> {
    @Override
    public UserDto mapRow(ResultSet rs, int rowNum) throws SQLException {
        UserDto userDto = new UserDto();

        userDto.setId(rs.getInt(1));
        userDto.setName(rs.getString(2));
        return userDto;
    }
}
